home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / rkeyboar.cpt / Reactive Keyboard ƒ / RK_BUTTON.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-20  |  987 b   |  28 lines

  1. /* definitions for rk_button, written by John Darragh, Calgary, revised 3-89
  2.  */
  3. #include <ctype.h>
  4. #include <stdio.h>
  5.  
  6. #define false        0
  7. #define true        1
  8. #define nil        ((NodePtr)0)
  9. #define MAX_SET        255         /* max # of different symbols (ASCII) */
  10. #define TOP_K        10
  11.  
  12. #define START        0            /* values for state variables         */
  13. #define SCANNING    1
  14. #define FOUND        2
  15. #define END        3
  16.  
  17. typedef struct node {                /** variable length Markov tree node **/
  18.         unsigned char  value;        /*  ASCII symbol value (to MAX_SET-1) */
  19.         char           count;        /*  frequency count (to max_freq)     */
  20.         struct node    *next;        /*  alternative predictions at this k */
  21.         struct node    *up;          /*  next k level up, eg 3 points to 4 */
  22. } Node;
  23. typedef Node  *NodePtr;              /** a pointer to a tree node      **/
  24. typedef NodePtr Buffer[TOP_K+1];     /*  k ptrs into the tree k contexts   */
  25.  
  26. NodePtr scan_up(), move_up();
  27. char    first_pred();
  28.